<template>
	<view class="">
		<view style="margin:20rpx 0rpx 0rpx 20rpx">每拉一新人注册购买会员,您可得：</view>
		<view v-if="sex == 'F'"style="margin:20rpx 0rpx 0rpx 20rpx" class="middle"> 
			<view>他首次购买vip的全部金额，全部返还给你哦</view>
			<view>您的朋友可得免费解密3个微信号的奖励</view>
			<view>心动不如行动，速速行动，丰厚奖励等着您</view>
			<view>您的邀请码：</view>
			<view style="font-size: 46rpx;">{{invitatioCode}}</view>
			<view style="color: #FFFFFF;" @click="fuzhi(invitatioCode)">点击复制</view>
		</view>
		<view v-if="sex == 'M'"style="margin:20rpx 0rpx 0rpx 20rpx" class="middle">
		<view>解密6个微信号的丰厚奖励，</view>	
		<view>您的朋友可得免费解密3个微信号的奖励</view>
		<view>心动不如行动，速速行动，丰厚奖励等着您</view>
		<view>您的邀请码：</view>
		<view style="font-size: 46rpx;">{{invitatioCode}}</view>
		<view style="color: #FFFFFF;" @click="fuzhi(invitatioCode)">点击复制</view>
		</view>
	</view>
</template>

<script>
	import * as api from '@/api/api.js'
	export default{
		data(){
			return{
				invitatioCode:'',
				sex:""
			}
		},
		onReady() {
			this.aaa();
			api.request({
				url: '/p/user/userInfo',
				method: 'GET',
			}).then(res=>{
				console.log(res)
				this.sex = res.data.sex
				this.invitatioCode = res.data.invitatioCode
			})
		},
		onLoad() {
			this.aaa();
			api.request({
				url: '/p/user/userInfo',
				method: 'GET',
			}).then(res=>{
				console.log(res)
				this.sex = res.data.sex
				this.invitatioCode = res.data.invitatioCode
			})
			
		},
		methods:{
			aaa(){
				api.request({
					url:'/p/user/invRecord',
					method:'GET'
				}).then(res =>{
					console.log(res)
				})
			},
			fuzhi(item) {
				console.log(item) 
				  uni.setClipboardData({
				             data: item,
				             success: function() {
				                 console.log('success');
								 uni.showToast({
								 	icon: 'none',
								 	title: '复制成功'
								 });
				             }
				        });
			
			},
		}
	}
</script>

<style>
	page{
		color: #FFFFFF;
		background-color: #242329;
		color:#FFA800
	}
	.middle>view{
		margin-top: 20rpx;
	}
</style>
